<?php
$homework_score = 0;
foreach ($my_info['Homework'] as $single_homework):
    $homework_score += $single_homework['score'];
endforeach;
$performance_score = 0;
foreach ($my_info['Performance'] as $single_performance):
    $performance_score += $single_performance['score'];
endforeach;
?>
<div class="title"><?php echo $my_info['StudentProfile']['real_name'] ?>的管理页</div>
<div class="logout"><?php echo $html->link("退出系统", array('controller' => 'users', 'action' => 'logout')); ?></div>
<div class="editinfo"><?php echo $html->link("编辑资料", array('controller' => 'student_profiles', 'action' => 'edit', $my_info['StudentProfile']['id'])); ?></div>
<div class="hscore">作业得分:<?php echo $homework_score; ?></div>
<div class="pscore">课堂表现得分:<?php echo $performance_score; ?></div>
<div class="tscore">总分:<?php echo $homework_score + $performance_score; ?></div>
<div class="entry"><?php echo $html->link("提交作业", array('controller' => 'homeworks', 'action' => 'add')); ?></div>